home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
4_17.lha
/
4_17
/
4_17a9.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
543b
|
25 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
/ allocate list element and
/ save current token info
nline tok *newtok(tok *curtok)
tok *thistok = new tok;
thistok->length = curtok->length;
if ((curtok->length > 0) && curtok->value)
{
thistok->value = new char[curtok->length + 1];
strcpy(thistok->value, curtok->value);
}
else
thistok->value = 0;
thistok->tok_type = curtok->tok_type;
thistok->next = 0;
return thistok;